package com.team7.happycommunity.propertymanagement.dao;

import com.team7.happycommunity.propertymanagement.pojo.Announcement;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AnnouncementMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Announcement record);

    int insertSelective(Announcement record);

    Announcement selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Announcement record);

    int updateByPrimaryKeyWithBLOBs(Announcement record);

    int updateByPrimaryKey(Announcement record);


    List<Announcement> findAnnoncementByPage(@Param("currentPage")Integer currentPage, @Param("pageSize") Integer pageSize,@Param("areaid") Integer areaid);

    /**
     * 更新其他同小区公告状态作废
     * @param areaid
     * @return
     */
    @Update("Update announcement set status = 1 where area_id = #{areaid}")
    int setStatusFalseByAreaId(Integer areaid);
}